import React from 'react';
import Index from './Pages/Index';
import Video from './Pages/Video';
import WorkPlace from './Pages/WorkPlace';
import "./index.css"
// v6版本的使用
import { BrowserRouter as Router, Routes, Route, Link } from "react-router-dom";

const AppRouter = () => {
    return (
        <Router>
            <div className="mainDiv">
                <div className="leftNav">
                    <h3>一级导航</h3>
                    <ul>
                        <li><Link to="/">博客首页</Link> </li>
                        <li><Link to="/video/">视频教程</Link> </li>
                        <li><Link to="/workPlace/">职场技能</Link> </li>
                    </ul>
                </div>

                <div className="rightMain">
                    <Routes>
                        <Route path="/*" exact element={<Index />} ></Route>
                        <Route path="/video/*" element={<Video />} ></Route>
                        <Route path="/workPlace/*" element={<WorkPlace />}></Route>
                    </Routes>
                </div>
            </div>
        </Router>
    )
}

export default AppRouter;